import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login'
import home from '@/components/home'
import manageEquipment from '@/components/manageEquipment'
import manageUser from '@/components/manageUser'
import primaryClassification from '@/components/primaryClassification'
import secondaryClassification from '@/components/secondaryClassification'
import manageProduct from '@/components/manageProduct'
import operateProduct from '@/components/operateProduct'
import manageRole from '@/components/manageRole'
import operateRole from '@/components/operateRole'
import manageUsers from '@/components/manageUsers'
import operateUser from '@/components/operateUser'
import contactUs from '@/components/contactUs'




Vue.use(Router)

export default new Router({
  // mode: 'history',
  base: 'mobile',
  routes: [
    {
      path: '/',
      name: 'login',
      component: login,
      meta:{
        Auth:false,//不需要登录验证
      }
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      meta:{
        Auth:true,//需要登录验证
      },
      // redirect:'/manageEquipment',
      children:[
        {
          path: '/manageEquipment',
          name: 'manageEquipment',
          component: manageEquipment,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/manageUser',
          name: 'manageUser',
          component: manageUser,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/primaryClassification',
          name: 'primaryClassification',
          component: primaryClassification,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/secondaryClassification',
          name: 'secondaryClassification',
          component: secondaryClassification,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/manageProduct',
          name: 'manageProduct',
          component: manageProduct,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/operateProduct/:type/:id',
          name: 'operateProduct',
          component: operateProduct,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/manageRole',
          name: 'manageRole',
          component: manageRole,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/operateRole/:type/:id',
          name: 'operateRole',
          component: operateRole,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/manageUsers',
          name: 'manageUsers',
          component: manageUsers,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/operateUser/:type/:id',
          name: 'operateUser',
          component: operateUser,
          meta:{
            Auth:true,//需要登录验证
          },
        },
        {
          path: '/contactUs',
          name: 'contactUs',
          component: contactUs,
          meta:{
            Auth:true,//需要登录验证
          },
        },
      ],
    }
  ]
})
